/**
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
var isSubsequence = function (s, t) {
    let count = 0
    for (let slow = 0, fast = 0; fast < t.length; fast++) {
        if (t[fast] === s[slow]) {
            slow++
            count++
        }
    }
    return count === s.length
};
console.log(isSubsequence("abc", "ahbgdc"));
